package com.sl.au.repository;

import java.util.Date;
import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.sl.au.entity.EventProcessToEvaluateUser;

public interface EventProcessToEvaluateUserRepository extends JpaRepository<EventProcessToEvaluateUser, String>{

	@Query("select e from EventProcessToEvaluateUser e where e.registerEvent.id=?1")
	List<EventProcessToEvaluateUser> findListByEventRegister(String register);
	
	@Query("select e from EventProcessToEvaluateUser e where e.registerUser.id=?1")
	List<EventProcessToEvaluateUser> findListByRegisterUser(String user);
	
	@Query("select e from EventProcessToEvaluateUser e where e.processType.id=?1")
	List<EventProcessToEvaluateUser> findListByProcessType(String option);
	
	@Query("select a from EventProcessToEvaluateUser a where a.registerUser.id=?1 and a.accTime > ?2 and a.accTime <?3 order by a.accTime desc")
	List<EventProcessToEvaluateUser> getUserProcessScoreListByDate(String userId, Date begin, Date end);
}
